<?php

class modContacts extends model
{
	function getAll($m)
	{
		$uM = $m->getModel('user');
		$uM->setUser(-1);
		
		$sContacts = $this->query("SELECT c.pUser, u.nickname, u.status, u.status_de FROM contacts c LEFT JOIN users u ON u.id = c.pUser WHERE c.cUser = '" . $uM->getID() . "'");
		
		if ($this->num($sContacts) > 0)
		{
			$contacts = array();
			
			while ($fContact = $this->fetch($sContacts))
			{
				$contacts[] = $fContact;
				
			} // end while
			
			return $contacts;
			
		} // end if
		else
			return array();
		
	} // end function
	
} // end class

$_ = 'modContacts';

?>